using org.tartarus.snowball.ext;
using weka.core.stemmers;

namespace MLSharp.Weka.Interop
{
	/// <summary>
	/// A wrapper for the snowball porter stemmer.
	/// </summary>
	public class PorterStemmerWrapper : Stemmer
	{
		#region Private Fields

		private englishStemmer mStemmer = new englishStemmer();

		#endregion

		#region Public Methods

		/// <summary>
		/// I'm not sure what this is for...
		/// </summary>
		/// <returns></returns>
		public string getRevision()
		{
			return "";
		}
		
		/// <summary>
		/// Stems the specified string.
		/// </summary>
		/// <param name="str"></param>
		/// <returns></returns>
		public string stem(string str)
		{
			mStemmer.setCurrent(str);
			mStemmer.stem();
			return mStemmer.getCurrent();
		}

		#endregion
	}
}